<?
if(!ANTIHACK) die("ANTIHACK...");
include_once(INCLUDES."buildlink.php");
global $baselink;
$smarty->assign("baselink",$baselink);
if($_GET["id"]!="")
{
	$id=$_GET["id"];
	$q=query("select * from post where id=$id");
	$f=fetch($q);
	$q=query("select * from post where parent=$f[parent] order by rand() limit 5");
	while($r=fetch($q))
	{
		$r["link"]=buildlink("post",$r);
		$data[]=$r;
	}
}
$smarty->assign("data_samecat",$data);
$smarty->display("same-cat.htm");
?>